<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    function test(a, b = 1) {
        console.log(a + b);
    }
    // test(1, 2)会覆盖b函数b里面的值

    function test1(a, b = 1) {
        console.log(a + b);
    }
    // test(1)b引用的是括号里面b的值

    function arr(a, b = 1) {
        console.log(a + b);
    }
    // test(1)b引用的是括号里面b的值

    function arr1(a, b = 1) {
        console.log(a + b);
    }
    // arr1(1, 2) 会覆盖b函数b里面的值

    function str(a, b = 1) {
        console.log(a + b);
    }
    // str(1,2) 2会覆盖函数里面b的值
    function str1(a, b = 1) {
        console.log(a + b);
    }
    // str(1)b的值引用的是括号里面b的值
</script>

</html>